﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace VersionComparer.DataModel.Xml
{
    public class XmlItemCreator : ComparableItemCreator 
    {
        protected override ComparableItem CreateFromValue(ItemId value)
        {
            try
            {
               
                string extension = Path.GetExtension(value.Name);
                if (string.Compare(extension, "dll", true) == 0 || string.Compare(extension, "exe", true) == 0)
                    return null;
                return new XmlFileItem(value.Name , value.Id);
            }
            catch
            {
                return null;
            }
        }

        public override string Text
        {
            get
            {
                return "Xml files";
            }
            set
            {
            }
        }
    }
}
